linkbutton: Use the LINK role
authorMatthias Clasen <mclasen@redhat.com>
Thu, 22 Oct 2020 01:54:17 +0000 (21:54 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 22 Oct 2020 02:19:54 +0000 (22:19 -0400)
It is a bit ambiguous, but I think link buttons are
more links than buttons. See WAI-ARIA for a discussion
of the differences.

Update tests to match.

docs/reference/gtk/section-accessibility.md
gtk/gtkenums.h
gtk/gtklinkbutton.c
testsuite/a11y/button.c

index 5ba59a5a46ec4cba788bebce5e2063868dd1bc89..c86eb3c3c19a13c3c157ec9d6c35f84dadf81ef6 100644 (file)
@@ -54,6 +54,7 @@ Each role name is part of the #GtkAccessibleRole enumeration.
 | `GRID_CELL` | An item in a grid | #GtkFlowBoxChild, #GtkGridView, #GtkColumnView |
 | `IMG` | An image | #GtkImage, #GtkPicture |
 | `LABEL` | A visible name or caption for a user interface component | #GtkLabel |
+| `LINK` | A clickable hyperlink | #GtkLinkButton |
 | `LIST` | A list of items | #GtkListBox |
 | `LIST_ITEM` | An item in a list | #GtkListBoxRow |
 | `MENU` | A menu | #GtkPopoverMenu |
index 40c793a8a12ab13d17a2624be2fd95bbd5f37ba9..9a64124c49b9570e65689c5962f5e1e4957689d4 100644 (file)
@@ -1183,7 +1183,7 @@ typedef enum {
  * @GTK_ACCESSIBLE_ROLE_LABEL: A visible name or caption for a user interface component.
  * @GTK_ACCESSIBLE_ROLE_LANDMARK: Abstract role.
  * @GTK_ACCESSIBLE_ROLE_LEGEND: Unused
- * @GTK_ACCESSIBLE_ROLE_LINK: Unused
+ * @GTK_ACCESSIBLE_ROLE_LINK: A clickable link.
  * @GTK_ACCESSIBLE_ROLE_LIST: A list of items.
  * @GTK_ACCESSIBLE_ROLE_LIST_BOX: Unused.
  * @GTK_ACCESSIBLE_ROLE_LIST_ITEM: An item in a list.
index 53a01cc2075f563fcec7babf15668e78687e33f0..e3baf93bc6369db51dce91aeaff30a3b78e39cbe 100644 (file)
@@ -50,7 +50,7 @@
  *
  * # Accessibility
  *
- * GtkLinkButton uses the #GTK_ACCESSIBLE_ROLE_BUTTON role.
+ * GtkLinkButton uses the #GTK_ACCESSIBLE_ROLE_LINK role.
  */
 
 #include "config.h"
@@ -220,7 +220,7 @@ gtk_link_button_class_init (GtkLinkButtonClass *klass)
                   G_TYPE_BOOLEAN, 0);
 
   gtk_widget_class_set_css_name (widget_class, I_("button"));
-  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_BUTTON);
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_LINK);
 
   /**
    * GtkLinkButton|clipboard.copy:
index a5e44280a4346d971061ece3d574a5b31859c87a..803a2fecf84fcf51e0a6ef881be88a8f1af198d9 100644 (file)
@@ -49,7 +49,7 @@ linkbutton_role (void)
   GtkWidget *button = gtk_link_button_new ("Hello");
   g_object_ref_sink (button);
 
-  gtk_test_accessible_assert_role (button, GTK_ACCESSIBLE_ROLE_BUTTON);
+  gtk_test_accessible_assert_role (button, GTK_ACCESSIBLE_ROLE_LINK);
 
   g_object_unref (button);
 }